package parts4.lesson55;



import java.util.Arrays;

public class Demo {

    public static void main(String[] args) {
        Person person[]=new Person[]{
                new Person("zhangshan",32),
                new Person("lisi",19),
                new Person("wangwu",76),
                new Person("chenhao",12)
        };
        //多new一个比较类，并且传给Arrays.sort()
        Arrays.sort(person,new PersonComparator());

        System.out.println(Arrays.toString(person));

    }
}
